package io.renren.modules.poschangedata.controller;

import java.util.Arrays;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.renren.modules.poschangedata.entity.PoschangeDataCopy1Entity;
import io.renren.modules.poschangedata.service.PoschangeDataCopy1Service;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;



/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2023-07-14 21:53:13
 */
@RestController
@RequestMapping("poschangedata/poschangedatacopy1")
public class PoschangeDataCopy1Controller {
    @Autowired
    private PoschangeDataCopy1Service poschangeDataCopy1Service;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("poschangedata:poschangedatacopy1:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = poschangeDataCopy1Service.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @RequiresPermissions("poschangedata:poschangedatacopy1:info")
    public R info(@PathVariable("id") String id){
		PoschangeDataCopy1Entity poschangeDataCopy1 = poschangeDataCopy1Service.getById(id);

        return R.ok().put("poschangeDataCopy1", poschangeDataCopy1);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("poschangedata:poschangedatacopy1:save")
    public R save(@RequestBody PoschangeDataCopy1Entity poschangeDataCopy1){
		poschangeDataCopy1Service.save(poschangeDataCopy1);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("poschangedata:poschangedatacopy1:update")
    public R update(@RequestBody PoschangeDataCopy1Entity poschangeDataCopy1){
		poschangeDataCopy1Service.updateById(poschangeDataCopy1);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("poschangedata:poschangedatacopy1:delete")
    public R delete(@RequestBody String[] ids){
		poschangeDataCopy1Service.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
